package com.ruoyi.supervise.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.supervise.domain.CompletionRecordInfo;
import com.ruoyi.supervise.domain.ConsturctionLicenceInfo;
import com.ruoyi.supervise.domain.MainLeft;
import com.ruoyi.supervise.domain.TbFocusProject;
import com.ruoyi.supervise.mapper.TbFocusProjectMapper;
import com.ruoyi.supervise.service.ITbFocusProjectService;

import cn.hutool.core.util.StrUtil;


/**
 * @ClassName: MyTestServiceImpl
 * @Description: 测试从数据源
 * @Author wtj
 * @DateTime 2020年3月9日 上午10:41:31
 */
@Service
public class TbFocusProjectServiceImpl implements ITbFocusProjectService 
{
    @Autowired
    private TbFocusProjectMapper tbFocusProjectMapper;

	@Override
	public List<TbFocusProject> selectTbFocusProjectList(TbFocusProject tfp) {
		List<TbFocusProject> tfpList = tbFocusProjectMapper.selectTbFocusProjectList(tfp);
		for(TbFocusProject tf:tfpList) {
			String[] subStr=StrUtil.split(tf.getConstructUnitId(), "|");
			if(subStr.length == 2) {
				tf.setConstructUnitId(subStr[1]);
        	}else {
        		tf.setConstructUnitId(" ");
        	}
		}
		return tfpList;
	}

	@Override
	public int updateTbFocusProjectFocus(TbFocusProject tfp) {
		// TODO Auto-generated method stub
		return tbFocusProjectMapper.updateTbFocusProjectFocus(tfp);
	}

	@Override
	public List<TbFocusProject> selectMainFocusProject() {
		// TODO Auto-generated method stub
		return tbFocusProjectMapper.selectMainFocusProject();
	}

	@Override
	public List<TbFocusProject> selectTbFocusProjectAll() {
		// TODO Auto-generated method stub
		return tbFocusProjectMapper.selectTbFocusProjectAll();
	}

}
